//
//  AttributedStringViewController.swift
//  swift各类控件集锦
//
//  Created by iosdev1 on 2017/5/12.
//  Copyright © 2017年 zyy. All rights reserved.
//

import UIKit

class AttributedStringViewController: ZyBaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.title = "title"
        
        
        let title = "运用富文本实现不同的颜色，大小，等等"
        let attributeString:NSMutableAttributedString = NSMutableAttributedString.init(string: title)
        attributeString.addAttribute(NSForegroundColorAttributeName, value: UIColor.red as Any, range: NSMakeRange(10, 2))
        attributeString.addAttribute(NSFontAttributeName, value: FONT(s: 32.0), range: NSMakeRange(13, 2))
        
        let lblAttributedString = zyUIlblInitWith(title: title, font: 15.0, color: UIColor.white, bgColor: UIColor.black)
        self.view.addSubview(lblAttributedString)
        lblAttributedString.frame = CGRect(x:20, y:80, width:300, height:80)
        lblAttributedString.attributedText = attributeString
        lblAttributedString.numberOfLines = 3
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
